<?php

namespace common\models\db\tables;

use Yii;

/**
 * This is the model class for table "{{%banners}}".
 *
 * @property int $id
 * @property int $created_at
 * @property int $updated_at
 * @property int $status 1正常2禁用
 * @property string $url
 * @property int $banner_sort
 * @property string $title
 */
class Banners extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%banners}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['created_at', 'updated_at', 'status', 'url', 'banner_sort', 'title'], 'trim'],
            [['created_at', 'updated_at', 'url', 'title'], 'required'],
            [['created_at', 'updated_at', 'status', 'banner_sort'], 'integer'],
            [['url', 'title'], 'string', 'max' => 180],
            [['status', 'banner_sort'], 'default', 'value' => 1],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('app', 'ID'),
            'created_at' => Yii::t('app', 'Created At'),
            'updated_at' => Yii::t('app', 'Updated At'),
            'status' => Yii::t('app', '1正常2禁用'),
            'url' => Yii::t('app', 'Url'),
            'banner_sort' => Yii::t('app', 'Banner Sort'),
            'title' => Yii::t('app', 'Title'),
        ];
    }
}
